package demo7;

import java.util.Scanner;

/*
键盘输入三个数，挑出来最大值
 */

public class TestScannerMAX {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入三个数：");
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();

        //简单的办法
        int temp = a>b?a:b;
        int max = temp>c?temp:c;
        System.out.println("最大的数是："+max);


        //用方法调用的办法
        //System.out.println("最大的数是："+max(a,b,c));

    }
    /*public static int max(int a,int b, int c){
        int d = 0;
        if(a>b){
            d=a;
        }else{
            d=b;
        }

        if(d<c){
            d=c;
        }else{
            d=d;
        }
        return d;
    }*/

}
